import { createStore } from 'vuex';
// const modulesFiles = import.meta.globEager('./modules/*.js')

// let modules = {}
// for (const path in modulesFiles) {
//   const moduleName = path.replace(/(.*\/)*([^.]+).*/gi, '$2')
//   modules = { ...modules, ...modulesFiles[path] }
// }
import createPersistedState from 'vuex-persistedstate';

export default createStore({
  state: {
    loginData: {},
  } as any,
  mutations: {
    setloginData: (state, data) => {
      state.loginData = data;
    },
  },
  actions: {
    getloginDatat: ({ commit }, data) => {
      commit('setloginData', data);
    },
  },
  // modules,
  plugins: [createPersistedState({ storage: window.localStorage })],
});
